﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace BigWoo.Apps.CertToolGui
{
    public class AllCommands
    {

        static AllCommands()
        {
            AllCommands.CreateAltBCommand();
            AllCommands.CreateAltCCommand();
            AllCommands.CreateAltFCommand();
            AllCommands.CreateAltICommand();
            AllCommands.CreateAltPCommand();
            AllCommands.CreateAltRCommand();
            AllCommands.CreateAltSCommand();
            AllCommands.CreateAltUCommand();
            AllCommands.CreateAltF2Command();
        }

        private static void CreateAltBCommand()
        {
            const System.Windows.Input.Key keyType = Key.B;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltBCommand = MakeRoutedCommand(keyType, modKey);
        }


        private static void CreateAltCCommand()
        {
            const System.Windows.Input.Key keyType = Key.C;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltCCommand = MakeRoutedCommand(keyType, modKey);
        }

        private static void CreateAltFCommand()
        {
            const System.Windows.Input.Key keyType = Key.F;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltFCommand = MakeRoutedCommand(keyType, modKey);
        }

        private static void CreateAltICommand()
        {
            const System.Windows.Input.Key keyType = Key.I;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltICommand = MakeRoutedCommand(keyType, modKey);
        }

        private static void CreateAltPCommand()
        {
            const System.Windows.Input.Key keyType = Key.P;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltPCommand = MakeRoutedCommand(keyType, modKey);
        }

        private static void CreateAltRCommand()
        {
            const System.Windows.Input.Key keyType = Key.R;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltRCommand = MakeRoutedCommand(keyType, modKey);
        }

        private static void CreateAltSCommand()
        {
            const System.Windows.Input.Key keyType = Key.S;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltSCommand = MakeRoutedCommand(keyType, modKey);
        }

        private static void CreateAltUCommand()
        {
            const System.Windows.Input.Key keyType = Key.U;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltUCommand = MakeRoutedCommand(keyType, modKey);

        }

        private static void CreateAltF2Command()
        {
            const System.Windows.Input.Key keyType = Key.F2;
            const System.Windows.Input.ModifierKeys modKey = ModifierKeys.Alt;

            AllCommands.AltF2Command = MakeRoutedCommand(keyType, modKey);

        }

        private static RoutedUICommand MakeRoutedCommand(Key keyType, ModifierKeys modKey)
        {
            string commandText = string.Format("{0}{1}Command", modKey, keyType);
            InputGestureCollection inputs = new InputGestureCollection();
            KeyGesture keyboardInput = new KeyGesture(keyType, modKey);
            inputs.Add(keyboardInput);

            return new RoutedUICommand(commandText, commandText, typeof(AllCommands), inputs);
        }

        public static RoutedUICommand AltBCommand { get; protected set; }
        public static RoutedUICommand AltCCommand { get; protected set; }
        public static RoutedUICommand AltFCommand { get; protected set; }
        public static RoutedUICommand AltICommand { get; protected set; }
        public static RoutedUICommand AltPCommand { get; protected set; }
        public static RoutedUICommand AltRCommand { get; protected set; }
        public static RoutedUICommand AltSCommand { get; protected set; }
        public static RoutedUICommand AltUCommand { get; protected set; }
        public static RoutedUICommand AltF2Command { get; protected set; }
    }
}
